home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Dialogs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  6.8 KB  |  228 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Dialogs.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __DIALOGS__
  13. #define __DIALOGS__
  14.  
  15. #ifndef __WINDOWS__
  16. #include <Windows.h>
  17. #endif
  18.  
  19. #ifndef __TEXTEDIT__
  20. #include <TextEdit.h>
  21. #endif
  22.  
  23.  
  24. enum {
  25.  
  26.     ctrlItem = 4,
  27.     btnCtrl = 0,
  28.     chkCtrl = 1,
  29.     radCtrl = 2,
  30.     resCtrl = 3,
  31.     statText = 8,
  32.     editText = 16,
  33.     iconItem = 32,
  34.     picItem = 64,
  35.     userItem = 0,
  36.     itemDisable = 128,
  37.     ok = 1,
  38.     cancel = 2,
  39.     stopIcon = 0,
  40.     noteIcon = 1,
  41.     cautionIcon = 2
  42. };
  43.  
  44. /*    Dialog Item List Manipulation Constants    */
  45. typedef short DITLMethod;
  46.  
  47. enum {
  48.  
  49.     overlayDITL = 0,
  50.     appendDITLRight = 1,
  51.     appendDITLBottom = 2
  52. };
  53.  
  54. typedef short StageList;
  55.  
  56.  
  57. typedef WindowPtr DialogPtr;
  58. typedef pascal void (*ResumeProcPtr)(void);
  59. typedef pascal void (*SoundProcPtr)(void);
  60. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  61.  
  62. struct DialogRecord {
  63.     WindowRecord window;
  64.     Handle items;
  65.     TEHandle textH;
  66.     short editField;
  67.     short editOpen;
  68.     short aDefItem;
  69. };
  70.  
  71. typedef struct DialogRecord DialogRecord;
  72. typedef DialogRecord *DialogPeek;
  73.  
  74. struct DialogTemplate {
  75.     Rect boundsRect;
  76.     short procID;
  77.     Boolean visible;
  78.     Boolean filler1;
  79.     Boolean goAwayFlag;
  80.     Boolean filler2;
  81.     long refCon;
  82.     short itemsID;
  83.     Str255 title;
  84. };
  85.  
  86. typedef struct DialogTemplate DialogTemplate;
  87. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  88.  
  89. struct AlertTemplate {
  90.     Rect boundsRect;
  91.     short itemsID;
  92.     StageList stages;
  93. };
  94.  
  95. typedef struct AlertTemplate AlertTemplate;
  96. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  97.  
  98.  
  99. #ifdef __cplusplus
  100. extern "C" {
  101. #endif
  102. pascal void InitDialogs(ResumeProcPtr resumeProc)
  103.     = 0xA97B; 
  104. pascal void ErrorSound(SoundProcPtr soundProc)
  105.     = 0xA98C; 
  106. pascal DialogPtr NewDialog(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  107.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  108.     Handle itmLstHndl)
  109.     = 0xA97D; 
  110. DialogPtr newdialog(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  111.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl); 
  112. pascal DialogPtr GetNewDialog(short dialogID,void *dStorage,WindowPtr behind)
  113.     = 0xA97C; 
  114. pascal void CloseDialog(DialogPtr theDialog)
  115.     = 0xA982; 
  116. pascal void DisposDialog(DialogPtr theDialog)
  117.     = 0xA983; 
  118. pascal void DisposeDialog(DialogPtr theDialog)
  119.     = 0xA983; 
  120. pascal void ParamText(ConstStr255Param param0,ConstStr255Param param1,ConstStr255Param param2,
  121.     ConstStr255Param param3)
  122.     = 0xA98B; 
  123. pascal void ModalDialog(ModalFilterProcPtr filterProc,short *itemHit)
  124.     = 0xA991; 
  125. pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  126.     = 0xA97F; 
  127. pascal Boolean DialogSelect(const EventRecord *theEvent,DialogPtr *theDialog,
  128.     short *itemHit)
  129.     = 0xA980; 
  130. pascal void DrawDialog(DialogPtr theDialog)
  131.     = 0xA981; 
  132. pascal void UpdateDialog(DialogPtr theDialog,RgnHandle updateRgn)
  133.     = 0xA978; 
  134. pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  135.     = 0xA978; 
  136. pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  137.     = 0xA985; 
  138. pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  139.     = 0xA986; 
  140. pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  141.     = 0xA987; 
  142. pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  143.     = 0xA988; 
  144. pascal void GetDialogItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  145.     Rect *box)
  146.     = 0xA98D; 
  147. pascal void GetDItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  148.     Rect *box)
  149.     = 0xA98D; 
  150. pascal void SetDialogItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  151.     const Rect *box)
  152.     = 0xA98E; 
  153. pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  154.     const Rect *box)
  155.     = 0xA98E; 
  156. pascal void HideDialogItem(DialogPtr theDialog,short itemNo)
  157.     = 0xA827; 
  158. pascal void HideDItem(DialogPtr theDialog,short itemNo)
  159.     = 0xA827; 
  160. pascal void ShowDialogItem(DialogPtr theDialog,short itemNo)
  161.     = 0xA828; 
  162. pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  163.     = 0xA828; 
  164. pascal void SelectDialogItemText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  165.     = 0xA97E; 
  166. pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  167.     = 0xA97E; 
  168. pascal void GetDialogItemText(Handle item,Str255 text)
  169.     = 0xA990; 
  170. pascal void GetIText(Handle item,Str255 text)
  171.     = 0xA990; 
  172. pascal void SetDialogItemText(Handle item,ConstStr255Param text)
  173.     = 0xA98F; 
  174. pascal void SetIText(Handle item,ConstStr255Param text)
  175.     = 0xA98F; 
  176. pascal short FindDialogItem(DialogPtr theDialog,Point thePt)
  177.     = 0xA984; 
  178. pascal short FindDItem(DialogPtr theDialog,Point thePt)
  179.     = 0xA984; 
  180. pascal DialogPtr NewColorDialog(void *dStorage,const Rect *boundsRect,ConstStr255Param title,
  181.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  182.     Handle items)
  183.     = 0xAA4B; 
  184. pascal DialogPtr NewCDialog(void *dStorage,const Rect *boundsRect,ConstStr255Param title,
  185.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  186.     Handle items)
  187.     = 0xAA4B; 
  188. DialogPtr newcolordialog(void *dStorage,const Rect *boundsRect,char *title,
  189.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  190.     Handle items); 
  191. DialogPtr newcdialog(void *dStorage,const Rect *boundsRect,char *title,
  192.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  193.     Handle items); 
  194. #define GetAlertStage() (* (short*) 0x0A9A)
  195. #define GetAlrtStage() (* (short*) 0x0A9A)
  196. pascal void ResetAlertStage(void)
  197.     = {0x4278,0x0A9A}; 
  198. pascal void ResetAlrtStage(void)
  199.     = {0x4278,0x0A9A}; 
  200. pascal void DialogCut(DialogPtr theDialog); 
  201. pascal void DlgCut(DialogPtr theDialog); 
  202. pascal void DialogPaste(DialogPtr theDialog); 
  203. pascal void DlgPaste(DialogPtr theDialog); 
  204. pascal void DialogCopy(DialogPtr theDialog); 
  205. pascal void DlgCopy(DialogPtr theDialog); 
  206. pascal void DialogDelete(DialogPtr theDialog); 
  207. pascal void DlgDelete(DialogPtr theDialog); 
  208. pascal void SetDialogFont(short fontNum)
  209.     = {0x31DF,0x0AFA}; 
  210. pascal void SetDAFont(short fontNum)
  211.     = {0x31DF,0x0AFA}; 
  212. void paramtext(char *param0,char *param1,char *param2,char *param3); 
  213. void getdialogitemtext(Handle item,char *text); 
  214. void getitext(Handle item,char *text); 
  215. void setdialogitemtext(Handle item,char *text); 
  216. void setitext(Handle item,char *text); 
  217. short finddialogitem(DialogPtr theDialog,Point *thePt); 
  218. short findditem(DialogPtr theDialog,Point *thePt); 
  219.  
  220. pascal void    AppendDITL(DialogPtr theDialog,Handle theHandle,DITLMethod method);
  221. pascal short CountDITL(DialogPtr theDialog);
  222. pascal void    ShortenDITL(DialogPtr theDialog,short numberItems);
  223. #ifdef __cplusplus
  224. }
  225. #endif
  226.  
  227. #endif
  228.